package com.second.app.thread.reentrant.interrupt;

/**
 * @author gyz
 * @date 2021/2/2 16:12
 */
public class Main {
    public static void main(String[] args) {
        try {
            LockInterruptTest lockInterruptTest = new LockInterruptTest();
            Runnable runnable = new Runnable() {
                @Override
                public void run() {
                    lockInterruptTest.waitMethod();
                }
            };

            Thread threadA = new Thread(runnable);
            threadA.setName("A线程");
            threadA.start();
            Thread.sleep(500);
            Thread threadB = new Thread(runnable);
            threadB.setName("B线程");
            threadB.start();
            threadB.interrupt();
            System.out.println("main end");

        } catch (InterruptedException e) {
            e.printStackTrace();
        }


    }
}
